package code.structure.module.signIn.view
{
	import code.structure.manager.loader.DllLoaderManager;
	import code.tools.commponents.Alignment;
	import code.tools.commponents.Component;
	import code.tools.commponents.StageAligner;
	import code.untils.SWFNameConst;
	
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	import flash.events.MouseEvent;

	/**
	 *签到入口icon 
	 * @author liangqian
	 * 
	 */	
	public class SignInEntryIcon extends Component
	{
		private var _clickCall:Function;
		public function SignInEntryIcon(parent:DisplayObjectContainer,clickCall:Function)
		{
			_clickCall = clickCall;
			super(parent);
		}
		
		override protected function addChildren():void
		{
			super.addChildren();
			
			var view:Sprite = new (DllLoaderManager.getInstance().getUIMaterial(SWFNameConst.SIGN_IN_PANEL,'entryIcon')as Class)as Sprite;
			addChild(view);
			
			addEventListener(MouseEvent.CLICK,clickHandler);
			
			stageAligner = new StageAligner(Alignment.TOP_RIGHT,-10,50);
		}
		
		override protected function init():void
		{
			setSize(46,38);
			super.init();
		}
		
		private function clickHandler(e:MouseEvent):void
		{
			_clickCall();
		}
	}
	
}